Skip to content

gnome3.gdm: Always reset the environment for new sessions#48517

Merged
jtojnar merged 1 commit intoNixOS:masterfrom
hedning:gdm-fix-environement
Oct 19, 2018
Merged

gnome3.gdm: Always reset the environment for new sessions#48517
jtojnar merged 1 commit intoNixOS:masterfrom
hedning:gdm-fix-environement

Conversation

@hedning
Copy link
Contributor

@hedning hedning commented Oct 16, 2018

Motivation for this change

When GDM launches a new session it will inherit the user's systemd
environment (but only unset variables). If __NIXOS_SET_ENVIRONMENT_DONE is set
in the user's systemd environment it will prevent the environment to be set
properly or updated (eg. after having done a system rebuild).

Gnome sessions exports their environment to systemd at startup. If something
is keeping the user's systemd process alive (eg. ssh) launching a new gnome
session after logging out will result in a broken PATH. Specifically the PATH
will be inherited from GDM and never reset.

We patch GDM to never inherit __NIXOS_SET_ENVIRONMENT_DONE so new sessions
will always reset their base environment.

fixes #48255

For more info about the environment setup:
#45784

cc @jtojnar

The issue is also present in 18.09 so this fix should be backported.

Things done

Tested in a VM that logging into a new gnome session works properly when ssh is active after logging out once.


When GDM launches a new session it will inherit the user's systemd
environment (but only unset variables). If `__NIXOS_SET_ENVIRONMENT_DONE` is set
in the user's systemd environment it will prevent the environment to be set
properly or updated (eg. after having done a system rebuild).

Gnome sessions exports their environment to systemd at startup. If something
is keeping the user's systemd process alive (eg. ssh) launching a new gnome
session after logging out will result in a broken PATH. Specifically the PATH
will be inherited from GDM and never reset.

We patch GDM to never inherit `__NIXOS_SET_ENVIRONMENT_DONE` so new sessions
will always reset their base environment.

fixes NixOS#48255

For more info about the environment setup:
NixOS#45784
@GrahamcOfBorg GrahamcOfBorg added 6.topic: GNOME GNOME desktop environment and its underlying platform 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Oct 16, 2018
@oxij
Copy link
Member

oxij commented Oct 19, 2018

Looks very hacky, but I guess it's the lesser of several possible evils. LGTM.

@jtojnar jtojnar merged commit c857cf9 into NixOS:master Oct 19, 2018
@jtojnar
Copy link
Member

jtojnar commented Oct 19, 2018

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: GNOME GNOME desktop environment and its underlying platform 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gnome3 loses contents of "default" profile

4 participants